package com.dragon.smtp.controller;


import com.dragon.smtp.domain.User;
import com.dragon.smtp.service.IUserService;
import com.dragon.smtp.util.DragonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 小龙
 * @since 2022-11-08
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;
    @PostMapping("/userLogin")
    DragonResult userLogin(@RequestBody User user){
        return userService.login(user);
    }

    @PostMapping("/userRegister")
    DragonResult userRegister(@RequestBody User user){
        return userService.register(user);
    }
    @PostMapping("/getFriends")
    DragonResult getFriends(@RequestBody User user){
        return userService.register(user);
    }
}

